import request from '@/utils/request'

const baseApi = process.env.VUE_APP_BASE_API2

// 获取用户列表
export function userList(obj) {
  return request({
    url: baseApi + '/user/userPage',
    method: 'get',
    params: obj
  })
}

// 添加用户
export function addUser(obj) {
  return request({
    url: baseApi + '/user/save',
    method: 'post',
    data: obj
  })
}

// 获取用户详情
export function getUserDetail(id) {
  return request({
    url: baseApi + '/user/detail/' + id,
    method: 'get'
  })
}

// 编辑用户
export function updateUser(obj) {
  return request({
    url: baseApi + '/user/update',
    method: 'post',
    data: obj
  })
}

// 删除用户
export function deleteUser(id) {
  return request({
    url: baseApi + '/user/delete/' + id,
    method: 'post'
  })
}
